﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using BesAsm.MasterData.Entities;
using BesAsm.MasterData.Data;

#endregion

namespace BesAsm.MasterData.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="DscProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class DscProviderBaseCore : EntityProviderBase<BesAsm.MasterData.Entities.Dsc, BesAsm.MasterData.Entities.DscKey>
	{		
		#region Get from Many To Many Relationship Functions
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, BesAsm.MasterData.Entities.DscKey key)
		{
			return Delete(transactionManager, key.DscId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_dscId">This is an amalgamation of the parcel_id and divide_id, with the divide_id padded to two digits with an additional zero.. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 _dscId)
		{
			return Delete(null, _dscId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_dscId">This is an amalgamation of the parcel_id and divide_id, with the divide_id padded to two digits with an additional zero.. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 _dscId);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_CP key.
		///		FK_DSCS_DETAILED_ZONES_CP Description: 
		/// </summary>
		/// <param name="_zoneCp">Detailed zoning for buildout conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByZoneCp(System.String _zoneCp)
		{
			int count = -1;
			return GetByZoneCp(_zoneCp, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_CP key.
		///		FK_DSCS_DETAILED_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneCp">Detailed zoning for buildout conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		/// <remarks></remarks>
		public TList<Dsc> GetByZoneCp(TransactionManager transactionManager, System.String _zoneCp)
		{
			int count = -1;
			return GetByZoneCp(transactionManager, _zoneCp, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_CP key.
		///		FK_DSCS_DETAILED_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneCp">Detailed zoning for buildout conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByZoneCp(TransactionManager transactionManager, System.String _zoneCp, int start, int pageLength)
		{
			int count = -1;
			return GetByZoneCp(transactionManager, _zoneCp, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_CP key.
		///		fkDscsDetailedZonesCp Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_zoneCp">Detailed zoning for buildout conditions</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByZoneCp(System.String _zoneCp, int start, int pageLength)
		{
			int count =  -1;
			return GetByZoneCp(null, _zoneCp, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_CP key.
		///		fkDscsDetailedZonesCp Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_zoneCp">Detailed zoning for buildout conditions</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByZoneCp(System.String _zoneCp, int start, int pageLength,out int count)
		{
			return GetByZoneCp(null, _zoneCp, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_CP key.
		///		FK_DSCS_DETAILED_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneCp">Detailed zoning for buildout conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public abstract TList<Dsc> GetByZoneCp(TransactionManager transactionManager, System.String _zoneCp, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_EX key.
		///		FK_DSCS_DETAILED_ZONES_EX Description: 
		/// </summary>
		/// <param name="_zoneEx">Detailed zoning code for existing conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByZoneEx(System.String _zoneEx)
		{
			int count = -1;
			return GetByZoneEx(_zoneEx, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_EX key.
		///		FK_DSCS_DETAILED_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneEx">Detailed zoning code for existing conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		/// <remarks></remarks>
		public TList<Dsc> GetByZoneEx(TransactionManager transactionManager, System.String _zoneEx)
		{
			int count = -1;
			return GetByZoneEx(transactionManager, _zoneEx, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_EX key.
		///		FK_DSCS_DETAILED_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneEx">Detailed zoning code for existing conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByZoneEx(TransactionManager transactionManager, System.String _zoneEx, int start, int pageLength)
		{
			int count = -1;
			return GetByZoneEx(transactionManager, _zoneEx, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_EX key.
		///		fkDscsDetailedZonesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_zoneEx">Detailed zoning code for existing conditions</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByZoneEx(System.String _zoneEx, int start, int pageLength)
		{
			int count =  -1;
			return GetByZoneEx(null, _zoneEx, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_EX key.
		///		fkDscsDetailedZonesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_zoneEx">Detailed zoning code for existing conditions</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByZoneEx(System.String _zoneEx, int start, int pageLength,out int count)
		{
			return GetByZoneEx(null, _zoneEx, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DETAILED_ZONES_EX key.
		///		FK_DSCS_DETAILED_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneEx">Detailed zoning code for existing conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public abstract TList<Dsc> GetByZoneEx(TransactionManager transactionManager, System.String _zoneEx, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DISCO_CLASSES key.
		///		FK_DSCS_DISCO_CLASSES Description: 
		/// </summary>
		/// <param name="_discoClass">Disco class</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByDiscoClass(System.String _discoClass)
		{
			int count = -1;
			return GetByDiscoClass(_discoClass, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DISCO_CLASSES key.
		///		FK_DSCS_DISCO_CLASSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_discoClass">Disco class</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		/// <remarks></remarks>
		public TList<Dsc> GetByDiscoClass(TransactionManager transactionManager, System.String _discoClass)
		{
			int count = -1;
			return GetByDiscoClass(transactionManager, _discoClass, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DISCO_CLASSES key.
		///		FK_DSCS_DISCO_CLASSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_discoClass">Disco class</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByDiscoClass(TransactionManager transactionManager, System.String _discoClass, int start, int pageLength)
		{
			int count = -1;
			return GetByDiscoClass(transactionManager, _discoClass, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DISCO_CLASSES key.
		///		fkDscsDiscoClasses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_discoClass">Disco class</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByDiscoClass(System.String _discoClass, int start, int pageLength)
		{
			int count =  -1;
			return GetByDiscoClass(null, _discoClass, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DISCO_CLASSES key.
		///		fkDscsDiscoClasses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_discoClass">Disco class</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByDiscoClass(System.String _discoClass, int start, int pageLength,out int count)
		{
			return GetByDiscoClass(null, _discoClass, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DISCO_CLASSES key.
		///		FK_DSCS_DISCO_CLASSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_discoClass">Disco class</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public abstract TList<Dsc> GetByDiscoClass(TransactionManager transactionManager, System.String _discoClass, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DSC_SOURCE_QUALITIES key.
		///		FK_DSCS_DSC_SOURCE_QUALITIES Description: 
		/// </summary>
		/// <param name="_dataSource">Null: Default
		/// 		/// A: As-built
		/// 		/// B: Building plan
		/// 		/// P: Plumbing record</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByDataSource(System.String _dataSource)
		{
			int count = -1;
			return GetByDataSource(_dataSource, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DSC_SOURCE_QUALITIES key.
		///		FK_DSCS_DSC_SOURCE_QUALITIES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_dataSource">Null: Default
		/// 		/// A: As-built
		/// 		/// B: Building plan
		/// 		/// P: Plumbing record</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		/// <remarks></remarks>
		public TList<Dsc> GetByDataSource(TransactionManager transactionManager, System.String _dataSource)
		{
			int count = -1;
			return GetByDataSource(transactionManager, _dataSource, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DSC_SOURCE_QUALITIES key.
		///		FK_DSCS_DSC_SOURCE_QUALITIES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_dataSource">Null: Default
		/// 		/// A: As-built
		/// 		/// B: Building plan
		/// 		/// P: Plumbing record</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByDataSource(TransactionManager transactionManager, System.String _dataSource, int start, int pageLength)
		{
			int count = -1;
			return GetByDataSource(transactionManager, _dataSource, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DSC_SOURCE_QUALITIES key.
		///		fkDscsDscSourceQualities Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_dataSource">Null: Default
		/// 		/// A: As-built
		/// 		/// B: Building plan
		/// 		/// P: Plumbing record</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByDataSource(System.String _dataSource, int start, int pageLength)
		{
			int count =  -1;
			return GetByDataSource(null, _dataSource, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DSC_SOURCE_QUALITIES key.
		///		fkDscsDscSourceQualities Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_dataSource">Null: Default
		/// 		/// A: As-built
		/// 		/// B: Building plan
		/// 		/// P: Plumbing record</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByDataSource(System.String _dataSource, int start, int pageLength,out int count)
		{
			return GetByDataSource(null, _dataSource, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_DSC_SOURCE_QUALITIES key.
		///		FK_DSCS_DSC_SOURCE_QUALITIES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_dataSource">Null: Default
		/// 		/// A: As-built
		/// 		/// B: Building plan
		/// 		/// P: Plumbing record</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public abstract TList<Dsc> GetByDataSource(TransactionManager transactionManager, System.String _dataSource, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_GROWTH_STATES key.
		///		FK_DSCS_GROWTH_STATES Description: 
		/// </summary>
		/// <param name="_growthState">Foreign key to GROWTH_STATES</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGrowthState(System.Int32? _growthState)
		{
			int count = -1;
			return GetByGrowthState(_growthState, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_GROWTH_STATES key.
		///		FK_DSCS_GROWTH_STATES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_growthState">Foreign key to GROWTH_STATES</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		/// <remarks></remarks>
		public TList<Dsc> GetByGrowthState(TransactionManager transactionManager, System.Int32? _growthState)
		{
			int count = -1;
			return GetByGrowthState(transactionManager, _growthState, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_GROWTH_STATES key.
		///		FK_DSCS_GROWTH_STATES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_growthState">Foreign key to GROWTH_STATES</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGrowthState(TransactionManager transactionManager, System.Int32? _growthState, int start, int pageLength)
		{
			int count = -1;
			return GetByGrowthState(transactionManager, _growthState, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_GROWTH_STATES key.
		///		fkDscsGrowthStates Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_growthState">Foreign key to GROWTH_STATES</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGrowthState(System.Int32? _growthState, int start, int pageLength)
		{
			int count =  -1;
			return GetByGrowthState(null, _growthState, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_GROWTH_STATES key.
		///		fkDscsGrowthStates Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_growthState">Foreign key to GROWTH_STATES</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGrowthState(System.Int32? _growthState, int start, int pageLength,out int count)
		{
			return GetByGrowthState(null, _growthState, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_GROWTH_STATES key.
		///		FK_DSCS_GROWTH_STATES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_growthState">Foreign key to GROWTH_STATES</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public abstract TList<Dsc> GetByGrowthState(TransactionManager transactionManager, System.Int32? _growthState, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_SEWERABILITIES key.
		///		FK_DSCS_SEWERABILITIES Description: 
		/// </summary>
		/// <param name="_sewerability">Foreign key to SEWERABILITIES</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetBySewerability(System.Int32? _sewerability)
		{
			int count = -1;
			return GetBySewerability(_sewerability, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_SEWERABILITIES key.
		///		FK_DSCS_SEWERABILITIES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sewerability">Foreign key to SEWERABILITIES</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		/// <remarks></remarks>
		public TList<Dsc> GetBySewerability(TransactionManager transactionManager, System.Int32? _sewerability)
		{
			int count = -1;
			return GetBySewerability(transactionManager, _sewerability, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_SEWERABILITIES key.
		///		FK_DSCS_SEWERABILITIES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sewerability">Foreign key to SEWERABILITIES</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetBySewerability(TransactionManager transactionManager, System.Int32? _sewerability, int start, int pageLength)
		{
			int count = -1;
			return GetBySewerability(transactionManager, _sewerability, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_SEWERABILITIES key.
		///		fkDscsSewerabilities Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_sewerability">Foreign key to SEWERABILITIES</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetBySewerability(System.Int32? _sewerability, int start, int pageLength)
		{
			int count =  -1;
			return GetBySewerability(null, _sewerability, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_SEWERABILITIES key.
		///		fkDscsSewerabilities Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_sewerability">Foreign key to SEWERABILITIES</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetBySewerability(System.Int32? _sewerability, int start, int pageLength,out int count)
		{
			return GetBySewerability(null, _sewerability, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_SEWERABILITIES key.
		///		FK_DSCS_SEWERABILITIES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sewerability">Foreign key to SEWERABILITIES</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public abstract TList<Dsc> GetBySewerability(TransactionManager transactionManager, System.Int32? _sewerability, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_STATUSES key.
		///		FK_DSCS_STATUSES Description: 
		/// </summary>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByStatus(System.String _status)
		{
			int count = -1;
			return GetByStatus(_status, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_STATUSES key.
		///		FK_DSCS_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		/// <remarks></remarks>
		public TList<Dsc> GetByStatus(TransactionManager transactionManager, System.String _status)
		{
			int count = -1;
			return GetByStatus(transactionManager, _status, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_STATUSES key.
		///		FK_DSCS_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByStatus(TransactionManager transactionManager, System.String _status, int start, int pageLength)
		{
			int count = -1;
			return GetByStatus(transactionManager, _status, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_STATUSES key.
		///		fkDscsStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByStatus(System.String _status, int start, int pageLength)
		{
			int count =  -1;
			return GetByStatus(null, _status, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_STATUSES key.
		///		fkDscsStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByStatus(System.String _status, int start, int pageLength,out int count)
		{
			return GetByStatus(null, _status, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_STATUSES key.
		///		FK_DSCS_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public abstract TList<Dsc> GetByStatus(TransactionManager transactionManager, System.String _status, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_CP key.
		///		FK_DSCS_ZONES_CP Description: 
		/// </summary>
		/// <param name="_generalZoneCp">General zoning code for buildout conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGeneralZoneCp(System.String _generalZoneCp)
		{
			int count = -1;
			return GetByGeneralZoneCp(_generalZoneCp, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_CP key.
		///		FK_DSCS_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneCp">General zoning code for buildout conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		/// <remarks></remarks>
		public TList<Dsc> GetByGeneralZoneCp(TransactionManager transactionManager, System.String _generalZoneCp)
		{
			int count = -1;
			return GetByGeneralZoneCp(transactionManager, _generalZoneCp, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_CP key.
		///		FK_DSCS_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneCp">General zoning code for buildout conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGeneralZoneCp(TransactionManager transactionManager, System.String _generalZoneCp, int start, int pageLength)
		{
			int count = -1;
			return GetByGeneralZoneCp(transactionManager, _generalZoneCp, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_CP key.
		///		fkDscsZonesCp Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_generalZoneCp">General zoning code for buildout conditions</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGeneralZoneCp(System.String _generalZoneCp, int start, int pageLength)
		{
			int count =  -1;
			return GetByGeneralZoneCp(null, _generalZoneCp, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_CP key.
		///		fkDscsZonesCp Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_generalZoneCp">General zoning code for buildout conditions</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGeneralZoneCp(System.String _generalZoneCp, int start, int pageLength,out int count)
		{
			return GetByGeneralZoneCp(null, _generalZoneCp, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_CP key.
		///		FK_DSCS_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneCp">General zoning code for buildout conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public abstract TList<Dsc> GetByGeneralZoneCp(TransactionManager transactionManager, System.String _generalZoneCp, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_EX key.
		///		FK_DSCS_ZONES_EX Description: 
		/// </summary>
		/// <param name="_generalZoneEx">General zoning code for existing conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGeneralZoneEx(System.String _generalZoneEx)
		{
			int count = -1;
			return GetByGeneralZoneEx(_generalZoneEx, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_EX key.
		///		FK_DSCS_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneEx">General zoning code for existing conditions</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		/// <remarks></remarks>
		public TList<Dsc> GetByGeneralZoneEx(TransactionManager transactionManager, System.String _generalZoneEx)
		{
			int count = -1;
			return GetByGeneralZoneEx(transactionManager, _generalZoneEx, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_EX key.
		///		FK_DSCS_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneEx">General zoning code for existing conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGeneralZoneEx(TransactionManager transactionManager, System.String _generalZoneEx, int start, int pageLength)
		{
			int count = -1;
			return GetByGeneralZoneEx(transactionManager, _generalZoneEx, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_EX key.
		///		fkDscsZonesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_generalZoneEx">General zoning code for existing conditions</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGeneralZoneEx(System.String _generalZoneEx, int start, int pageLength)
		{
			int count =  -1;
			return GetByGeneralZoneEx(null, _generalZoneEx, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_EX key.
		///		fkDscsZonesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_generalZoneEx">General zoning code for existing conditions</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public TList<Dsc> GetByGeneralZoneEx(System.String _generalZoneEx, int start, int pageLength,out int count)
		{
			return GetByGeneralZoneEx(null, _generalZoneEx, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_DSCS_ZONES_EX key.
		///		FK_DSCS_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneEx">General zoning code for existing conditions</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.Dsc objects.</returns>
		public abstract TList<Dsc> GetByGeneralZoneEx(TransactionManager transactionManager, System.String _generalZoneEx, int start, int pageLength, out int count);
		
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override BesAsm.MasterData.Entities.Dsc Get(TransactionManager transactionManager, BesAsm.MasterData.Entities.DscKey key, int start, int pageLength)
		{
			return GetByDscId(transactionManager, key.DscId, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key idx_san_to_link_id index.
		/// </summary>
		/// <param name="_sanToLinkId">The link to which the DSC drains its sanitary flow.</param>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetBySanToLinkId(System.Int32? _sanToLinkId)
		{
			int count = -1;
			return GetBySanToLinkId(null,_sanToLinkId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_san_to_link_id index.
		/// </summary>
		/// <param name="_sanToLinkId">The link to which the DSC drains its sanitary flow.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetBySanToLinkId(System.Int32? _sanToLinkId, int start, int pageLength)
		{
			int count = -1;
			return GetBySanToLinkId(null, _sanToLinkId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_san_to_link_id index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sanToLinkId">The link to which the DSC drains its sanitary flow.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetBySanToLinkId(TransactionManager transactionManager, System.Int32? _sanToLinkId)
		{
			int count = -1;
			return GetBySanToLinkId(transactionManager, _sanToLinkId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_san_to_link_id index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sanToLinkId">The link to which the DSC drains its sanitary flow.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetBySanToLinkId(TransactionManager transactionManager, System.Int32? _sanToLinkId, int start, int pageLength)
		{
			int count = -1;
			return GetBySanToLinkId(transactionManager, _sanToLinkId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_san_to_link_id index.
		/// </summary>
		/// <param name="_sanToLinkId">The link to which the DSC drains its sanitary flow.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetBySanToLinkId(System.Int32? _sanToLinkId, int start, int pageLength, out int count)
		{
			return GetBySanToLinkId(null, _sanToLinkId, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_san_to_link_id index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sanToLinkId">The link to which the DSC drains its sanitary flow.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public abstract TList<Dsc> GetBySanToLinkId(TransactionManager transactionManager, System.Int32? _sanToLinkId, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key idx_storm_to_link_id index.
		/// </summary>
		/// <param name="_stormToLinkId">The link to which the DSC drains its storm flow. May be null, indicating all flows drain to the to_san_link_id.</param>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetByStormToLinkId(System.Int32? _stormToLinkId)
		{
			int count = -1;
			return GetByStormToLinkId(null,_stormToLinkId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_storm_to_link_id index.
		/// </summary>
		/// <param name="_stormToLinkId">The link to which the DSC drains its storm flow. May be null, indicating all flows drain to the to_san_link_id.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetByStormToLinkId(System.Int32? _stormToLinkId, int start, int pageLength)
		{
			int count = -1;
			return GetByStormToLinkId(null, _stormToLinkId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_storm_to_link_id index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_stormToLinkId">The link to which the DSC drains its storm flow. May be null, indicating all flows drain to the to_san_link_id.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetByStormToLinkId(TransactionManager transactionManager, System.Int32? _stormToLinkId)
		{
			int count = -1;
			return GetByStormToLinkId(transactionManager, _stormToLinkId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_storm_to_link_id index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_stormToLinkId">The link to which the DSC drains its storm flow. May be null, indicating all flows drain to the to_san_link_id.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetByStormToLinkId(TransactionManager transactionManager, System.Int32? _stormToLinkId, int start, int pageLength)
		{
			int count = -1;
			return GetByStormToLinkId(transactionManager, _stormToLinkId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_storm_to_link_id index.
		/// </summary>
		/// <param name="_stormToLinkId">The link to which the DSC drains its storm flow. May be null, indicating all flows drain to the to_san_link_id.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public TList<Dsc> GetByStormToLinkId(System.Int32? _stormToLinkId, int start, int pageLength, out int count)
		{
			return GetByStormToLinkId(null, _stormToLinkId, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the idx_storm_to_link_id index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_stormToLinkId">The link to which the DSC drains its storm flow. May be null, indicating all flows drain to the to_san_link_id.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="TList&lt;Dsc&gt;"/> class.</returns>
		public abstract TList<Dsc> GetByStormToLinkId(TransactionManager transactionManager, System.Int32? _stormToLinkId, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_DSCS index.
		/// </summary>
		/// <param name="_dscId">This is an amalgamation of the parcel_id and divide_id, with the divide_id padded to two digits with an additional zero.</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByDscId(System.Int32 _dscId)
		{
			int count = -1;
			return GetByDscId(null,_dscId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DSCS index.
		/// </summary>
		/// <param name="_dscId">This is an amalgamation of the parcel_id and divide_id, with the divide_id padded to two digits with an additional zero.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByDscId(System.Int32 _dscId, int start, int pageLength)
		{
			int count = -1;
			return GetByDscId(null, _dscId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DSCS index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_dscId">This is an amalgamation of the parcel_id and divide_id, with the divide_id padded to two digits with an additional zero.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByDscId(TransactionManager transactionManager, System.Int32 _dscId)
		{
			int count = -1;
			return GetByDscId(transactionManager, _dscId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DSCS index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_dscId">This is an amalgamation of the parcel_id and divide_id, with the divide_id padded to two digits with an additional zero.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByDscId(TransactionManager transactionManager, System.Int32 _dscId, int start, int pageLength)
		{
			int count = -1;
			return GetByDscId(transactionManager, _dscId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DSCS index.
		/// </summary>
		/// <param name="_dscId">This is an amalgamation of the parcel_id and divide_id, with the divide_id padded to two digits with an additional zero.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByDscId(System.Int32 _dscId, int start, int pageLength, out int count)
		{
			return GetByDscId(null, _dscId, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_DSCS index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_dscId">This is an amalgamation of the parcel_id and divide_id, with the divide_id padded to two digits with an additional zero.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public abstract BesAsm.MasterData.Entities.Dsc GetByDscId(TransactionManager transactionManager, System.Int32 _dscId, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key R143_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByObjectid(System.Int32 _objectid)
		{
			int count = -1;
			return GetByObjectid(null,_objectid, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R143_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByObjectid(System.Int32 _objectid, int start, int pageLength)
		{
			int count = -1;
			return GetByObjectid(null, _objectid, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R143_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid)
		{
			int count = -1;
			return GetByObjectid(transactionManager, _objectid, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R143_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid, int start, int pageLength)
		{
			int count = -1;
			return GetByObjectid(transactionManager, _objectid, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R143_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public BesAsm.MasterData.Entities.Dsc GetByObjectid(System.Int32 _objectid, int start, int pageLength, out int count)
		{
			return GetByObjectid(null, _objectid, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the R143_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.Dsc"/> class.</returns>
		public abstract BesAsm.MasterData.Entities.Dsc GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#region USP_DSCS_SELECT_OIDS_BY_LINK_IDS 
		
		/// <summary>
		///	This method wrap the 'USP_DSCS_SELECT_OIDS_BY_LINK_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet SelectOidsByLinkIds(System.Object idTable)
		{
			return SelectOidsByLinkIds(null, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_DSCS_SELECT_OIDS_BY_LINK_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet SelectOidsByLinkIds(int start, int pageLength, System.Object idTable)
		{
			return SelectOidsByLinkIds(null, start, pageLength , idTable);
		}
				
		/// <summary>
		///	This method wrap the 'USP_DSCS_SELECT_OIDS_BY_LINK_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet SelectOidsByLinkIds(TransactionManager transactionManager, System.Object idTable)
		{
			return SelectOidsByLinkIds(transactionManager, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_DSCS_SELECT_OIDS_BY_LINK_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public abstract DataSet SelectOidsByLinkIds(TransactionManager transactionManager, int start, int pageLength , System.Object idTable);
		
		#endregion
		
		#region USP_DSCS_SELECT_BY_OIDS 
		
		/// <summary>
		///	This method wrap the 'USP_DSCS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;Dsc&gt;"/> instance.</returns>
		public TList<Dsc> SelectByOids(System.Object idTable)
		{
			return SelectByOids(null, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_DSCS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;Dsc&gt;"/> instance.</returns>
		public TList<Dsc> SelectByOids(int start, int pageLength, System.Object idTable)
		{
			return SelectByOids(null, start, pageLength , idTable);
		}
				
		/// <summary>
		///	This method wrap the 'USP_DSCS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;Dsc&gt;"/> instance.</returns>
		public TList<Dsc> SelectByOids(TransactionManager transactionManager, System.Object idTable)
		{
			return SelectByOids(transactionManager, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_DSCS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;Dsc&gt;"/> instance.</returns>
		public abstract TList<Dsc> SelectByOids(TransactionManager transactionManager, int start, int pageLength , System.Object idTable);
		
		#endregion
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;Dsc&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;Dsc&gt;"/></returns>
		public static TList<Dsc> Fill(IDataReader reader, TList<Dsc> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				BesAsm.MasterData.Entities.Dsc c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("Dsc")
					.Append("|").Append((System.Int32)reader[((int)DscColumn.DscId - 1)]).ToString();
					c = EntityManager.LocateOrCreate<Dsc>(
					key.ToString(), // EntityTrackingKey
					"Dsc",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new BesAsm.MasterData.Entities.Dsc();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.Objectid = (System.Int32)reader[((int)DscColumn.Objectid - 1)];
					c.ParcelId = (reader.IsDBNull(((int)DscColumn.ParcelId - 1)))?null:(System.Int32?)reader[((int)DscColumn.ParcelId - 1)];
					c.DivideId = (reader.IsDBNull(((int)DscColumn.DivideId - 1)))?null:(System.Int32?)reader[((int)DscColumn.DivideId - 1)];
					c.DscId = (System.Int32)reader[((int)DscColumn.DscId - 1)];
					c.OriginalDscId = c.DscId;
					c.DiscoSiteId = (reader.IsDBNull(((int)DscColumn.DiscoSiteId - 1)))?null:(System.Int32?)reader[((int)DscColumn.DiscoSiteId - 1)];
					c.DiscoClass = (System.String)reader[((int)DscColumn.DiscoClass - 1)];
					c.SanToLinkId = (reader.IsDBNull(((int)DscColumn.SanToLinkId - 1)))?null:(System.Int32?)reader[((int)DscColumn.SanToLinkId - 1)];
					c.StormToLinkId = (reader.IsDBNull(((int)DscColumn.StormToLinkId - 1)))?null:(System.Int32?)reader[((int)DscColumn.StormToLinkId - 1)];
					c.SanPipeFlowType = (reader.IsDBNull(((int)DscColumn.SanPipeFlowType - 1)))?null:(System.String)reader[((int)DscColumn.SanPipeFlowType - 1)];
					c.StormPipeFlowType = (reader.IsDBNull(((int)DscColumn.StormPipeFlowType - 1)))?null:(System.String)reader[((int)DscColumn.StormPipeFlowType - 1)];
					c.SewerCrown = (reader.IsDBNull(((int)DscColumn.SewerCrown - 1)))?null:(System.Decimal?)reader[((int)DscColumn.SewerCrown - 1)];
					c.GrowthState = (reader.IsDBNull(((int)DscColumn.GrowthState - 1)))?null:(System.Int32?)reader[((int)DscColumn.GrowthState - 1)];
					c.CpUsedForFuAreaIncrease = (reader.IsDBNull(((int)DscColumn.CpUsedForFuAreaIncrease - 1)))?null:(System.Int32?)reader[((int)DscColumn.CpUsedForFuAreaIncrease - 1)];
					c.GisBasin = (reader.IsDBNull(((int)DscColumn.GisBasin - 1)))?null:(System.String)reader[((int)DscColumn.GisBasin - 1)];
					c.IcRoofEx = (reader.IsDBNull(((int)DscColumn.IcRoofEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IcRoofEx - 1)];
					c.IcRoofFu = (reader.IsDBNull(((int)DscColumn.IcRoofFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IcRoofFu - 1)];
					c.IcParkingEx = (reader.IsDBNull(((int)DscColumn.IcParkingEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IcParkingEx - 1)];
					c.IcParkingFu = (reader.IsDBNull(((int)DscColumn.IcParkingFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IcParkingFu - 1)];
					c.EffectiveIcRoofEx = (reader.IsDBNull(((int)DscColumn.EffectiveIcRoofEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.EffectiveIcRoofEx - 1)];
					c.EffectiveIcParkingEx = (reader.IsDBNull(((int)DscColumn.EffectiveIcParkingEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.EffectiveIcParkingEx - 1)];
					c.EffectiveIcRoofFu = (reader.IsDBNull(((int)DscColumn.EffectiveIcRoofFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.EffectiveIcRoofFu - 1)];
					c.EffectiveIcParkingFu = (reader.IsDBNull(((int)DscColumn.EffectiveIcParkingFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.EffectiveIcParkingFu - 1)];
					c.Sewerability = (reader.IsDBNull(((int)DscColumn.Sewerability - 1)))?null:(System.Int32?)reader[((int)DscColumn.Sewerability - 1)];
					c.DataSource = (reader.IsDBNull(((int)DscColumn.DataSource - 1)))?null:(System.String)reader[((int)DscColumn.DataSource - 1)];
					c.LocalTreatment = (reader.IsDBNull(((int)DscColumn.LocalTreatment - 1)))?null:(System.Int32?)reader[((int)DscColumn.LocalTreatment - 1)];
					c.InProtectedEnviroZone = (reader.IsDBNull(((int)DscColumn.InProtectedEnviroZone - 1)))?null:(System.Int32?)reader[((int)DscColumn.InProtectedEnviroZone - 1)];
					c.HasBasement = (reader.IsDBNull(((int)DscColumn.HasBasement - 1)))?null:(System.Int32?)reader[((int)DscColumn.HasBasement - 1)];
					c.PropertyId = (reader.IsDBNull(((int)DscColumn.PropertyId - 1)))?null:(System.String)reader[((int)DscColumn.PropertyId - 1)];
					c.ConnFracFromLinkUsNode = (reader.IsDBNull(((int)DscColumn.ConnFracFromLinkUsNode - 1)))?null:(System.Decimal?)reader[((int)DscColumn.ConnFracFromLinkUsNode - 1)];
					c.FloodReferenceElevation = (reader.IsDBNull(((int)DscColumn.FloodReferenceElevation - 1)))?null:(System.Decimal?)reader[((int)DscColumn.FloodReferenceElevation - 1)];
					c.FalseBasementBackupRisk = (reader.IsDBNull(((int)DscColumn.FalseBasementBackupRisk - 1)))?null:(System.Int32?)reader[((int)DscColumn.FalseBasementBackupRisk - 1)];
					c.StateRnoId = (reader.IsDBNull(((int)DscColumn.StateRnoId - 1)))?null:(System.String)reader[((int)DscColumn.StateRnoId - 1)];
					c.Owner1 = (reader.IsDBNull(((int)DscColumn.Owner1 - 1)))?null:(System.String)reader[((int)DscColumn.Owner1 - 1)];
					c.Owner2 = (reader.IsDBNull(((int)DscColumn.Owner2 - 1)))?null:(System.String)reader[((int)DscColumn.Owner2 - 1)];
					c.Owner3 = (reader.IsDBNull(((int)DscColumn.Owner3 - 1)))?null:(System.String)reader[((int)DscColumn.Owner3 - 1)];
					c.OwnerAddress = (reader.IsDBNull(((int)DscColumn.OwnerAddress - 1)))?null:(System.String)reader[((int)DscColumn.OwnerAddress - 1)];
					c.OwnerCity = (reader.IsDBNull(((int)DscColumn.OwnerCity - 1)))?null:(System.String)reader[((int)DscColumn.OwnerCity - 1)];
					c.OwnerState = (reader.IsDBNull(((int)DscColumn.OwnerState - 1)))?null:(System.String)reader[((int)DscColumn.OwnerState - 1)];
					c.OwnerZip = (reader.IsDBNull(((int)DscColumn.OwnerZip - 1)))?null:(System.String)reader[((int)DscColumn.OwnerZip - 1)];
					c.SiteAddress = (reader.IsDBNull(((int)DscColumn.SiteAddress - 1)))?null:(System.String)reader[((int)DscColumn.SiteAddress - 1)];
					c.SiteCity = (reader.IsDBNull(((int)DscColumn.SiteCity - 1)))?null:(System.String)reader[((int)DscColumn.SiteCity - 1)];
					c.SiteState = (reader.IsDBNull(((int)DscColumn.SiteState - 1)))?null:(System.String)reader[((int)DscColumn.SiteState - 1)];
					c.SiteZip = (reader.IsDBNull(((int)DscColumn.SiteZip - 1)))?null:(System.String)reader[((int)DscColumn.SiteZip - 1)];
					c.FloodReferenceElevation2 = (reader.IsDBNull(((int)DscColumn.FloodReferenceElevation2 - 1)))?null:(System.Decimal?)reader[((int)DscColumn.FloodReferenceElevation2 - 1)];
					c.IsVacant = (System.Int32)reader[((int)DscColumn.IsVacant - 1)];
					c.ZoneEx = (reader.IsDBNull(((int)DscColumn.ZoneEx - 1)))?null:(System.String)reader[((int)DscColumn.ZoneEx - 1)];
					c.ZoneCp = (reader.IsDBNull(((int)DscColumn.ZoneCp - 1)))?null:(System.String)reader[((int)DscColumn.ZoneCp - 1)];
					c.GeneralZoneEx = (reader.IsDBNull(((int)DscColumn.GeneralZoneEx - 1)))?null:(System.String)reader[((int)DscColumn.GeneralZoneEx - 1)];
					c.GeneralZoneCp = (reader.IsDBNull(((int)DscColumn.GeneralZoneCp - 1)))?null:(System.String)reader[((int)DscColumn.GeneralZoneCp - 1)];
					c.ProtectedEnviroZone = (reader.IsDBNull(((int)DscColumn.ProtectedEnviroZone - 1)))?null:(System.Decimal?)reader[((int)DscColumn.ProtectedEnviroZone - 1)];
					c.IaFractionEx = (reader.IsDBNull(((int)DscColumn.IaFractionEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IaFractionEx - 1)];
					c.IaFractionCp = (reader.IsDBNull(((int)DscColumn.IaFractionCp - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IaFractionCp - 1)];
					c.IaFractionFu = (reader.IsDBNull(((int)DscColumn.IaFractionFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IaFractionFu - 1)];
					c.TotalArea = (reader.IsDBNull(((int)DscColumn.TotalArea - 1)))?null:(System.Decimal?)reader[((int)DscColumn.TotalArea - 1)];
					c.RoofAreaEx = (reader.IsDBNull(((int)DscColumn.RoofAreaEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.RoofAreaEx - 1)];
					c.RoofAreaFu = (reader.IsDBNull(((int)DscColumn.RoofAreaFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.RoofAreaFu - 1)];
					c.ParkingAreaEx = (reader.IsDBNull(((int)DscColumn.ParkingAreaEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.ParkingAreaEx - 1)];
					c.ParkingAreaFu = (reader.IsDBNull(((int)DscColumn.ParkingAreaFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.ParkingAreaFu - 1)];
					c.BaseflowEx = (reader.IsDBNull(((int)DscColumn.BaseflowEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.BaseflowEx - 1)];
					c.BaseflowFu = (reader.IsDBNull(((int)DscColumn.BaseflowFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.BaseflowFu - 1)];
					c.BaseflowDesignManual = (reader.IsDBNull(((int)DscColumn.BaseflowDesignManual - 1)))?null:(System.Decimal?)reader[((int)DscColumn.BaseflowDesignManual - 1)];
					c.EditedBy = (System.String)reader[((int)DscColumn.EditedBy - 1)];
					c.EditReason = (System.String)reader[((int)DscColumn.EditReason - 1)];
					c.Status = (System.String)reader[((int)DscColumn.Status - 1)];
					c.AppendDate = (System.DateTime)reader[((int)DscColumn.AppendDate - 1)];
					c.EditDate = (reader.IsDBNull(((int)DscColumn.EditDate - 1)))?null:(System.DateTime?)reader[((int)DscColumn.EditDate - 1)];
					c.SanToMlinkidDeprecated = (reader.IsDBNull(((int)DscColumn.SanToMlinkidDeprecated - 1)))?null:(System.Int32?)reader[((int)DscColumn.SanToMlinkidDeprecated - 1)];
					c.StormToMlinkidDeprecated = (reader.IsDBNull(((int)DscColumn.StormToMlinkidDeprecated - 1)))?null:(System.Int32?)reader[((int)DscColumn.StormToMlinkidDeprecated - 1)];
					c.DscidDeprecated = (reader.IsDBNull(((int)DscColumn.DscidDeprecated - 1)))?null:(System.Int32?)reader[((int)DscColumn.DscidDeprecated - 1)];
					c.Shape = (reader.IsDBNull(((int)DscColumn.Shape - 1)))?null:(System.Object)reader[((int)DscColumn.Shape - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="BesAsm.MasterData.Entities.Dsc"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.Dsc"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, BesAsm.MasterData.Entities.Dsc entity)
		{
			if (!reader.Read()) return;
			
			entity.Objectid = (System.Int32)reader[((int)DscColumn.Objectid - 1)];
			entity.ParcelId = (reader.IsDBNull(((int)DscColumn.ParcelId - 1)))?null:(System.Int32?)reader[((int)DscColumn.ParcelId - 1)];
			entity.DivideId = (reader.IsDBNull(((int)DscColumn.DivideId - 1)))?null:(System.Int32?)reader[((int)DscColumn.DivideId - 1)];
			entity.DscId = (System.Int32)reader[((int)DscColumn.DscId - 1)];
			entity.OriginalDscId = (System.Int32)reader["dsc_id"];
			entity.DiscoSiteId = (reader.IsDBNull(((int)DscColumn.DiscoSiteId - 1)))?null:(System.Int32?)reader[((int)DscColumn.DiscoSiteId - 1)];
			entity.DiscoClass = (System.String)reader[((int)DscColumn.DiscoClass - 1)];
			entity.SanToLinkId = (reader.IsDBNull(((int)DscColumn.SanToLinkId - 1)))?null:(System.Int32?)reader[((int)DscColumn.SanToLinkId - 1)];
			entity.StormToLinkId = (reader.IsDBNull(((int)DscColumn.StormToLinkId - 1)))?null:(System.Int32?)reader[((int)DscColumn.StormToLinkId - 1)];
			entity.SanPipeFlowType = (reader.IsDBNull(((int)DscColumn.SanPipeFlowType - 1)))?null:(System.String)reader[((int)DscColumn.SanPipeFlowType - 1)];
			entity.StormPipeFlowType = (reader.IsDBNull(((int)DscColumn.StormPipeFlowType - 1)))?null:(System.String)reader[((int)DscColumn.StormPipeFlowType - 1)];
			entity.SewerCrown = (reader.IsDBNull(((int)DscColumn.SewerCrown - 1)))?null:(System.Decimal?)reader[((int)DscColumn.SewerCrown - 1)];
			entity.GrowthState = (reader.IsDBNull(((int)DscColumn.GrowthState - 1)))?null:(System.Int32?)reader[((int)DscColumn.GrowthState - 1)];
			entity.CpUsedForFuAreaIncrease = (reader.IsDBNull(((int)DscColumn.CpUsedForFuAreaIncrease - 1)))?null:(System.Int32?)reader[((int)DscColumn.CpUsedForFuAreaIncrease - 1)];
			entity.GisBasin = (reader.IsDBNull(((int)DscColumn.GisBasin - 1)))?null:(System.String)reader[((int)DscColumn.GisBasin - 1)];
			entity.IcRoofEx = (reader.IsDBNull(((int)DscColumn.IcRoofEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IcRoofEx - 1)];
			entity.IcRoofFu = (reader.IsDBNull(((int)DscColumn.IcRoofFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IcRoofFu - 1)];
			entity.IcParkingEx = (reader.IsDBNull(((int)DscColumn.IcParkingEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IcParkingEx - 1)];
			entity.IcParkingFu = (reader.IsDBNull(((int)DscColumn.IcParkingFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IcParkingFu - 1)];
			entity.EffectiveIcRoofEx = (reader.IsDBNull(((int)DscColumn.EffectiveIcRoofEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.EffectiveIcRoofEx - 1)];
			entity.EffectiveIcParkingEx = (reader.IsDBNull(((int)DscColumn.EffectiveIcParkingEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.EffectiveIcParkingEx - 1)];
			entity.EffectiveIcRoofFu = (reader.IsDBNull(((int)DscColumn.EffectiveIcRoofFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.EffectiveIcRoofFu - 1)];
			entity.EffectiveIcParkingFu = (reader.IsDBNull(((int)DscColumn.EffectiveIcParkingFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.EffectiveIcParkingFu - 1)];
			entity.Sewerability = (reader.IsDBNull(((int)DscColumn.Sewerability - 1)))?null:(System.Int32?)reader[((int)DscColumn.Sewerability - 1)];
			entity.DataSource = (reader.IsDBNull(((int)DscColumn.DataSource - 1)))?null:(System.String)reader[((int)DscColumn.DataSource - 1)];
			entity.LocalTreatment = (reader.IsDBNull(((int)DscColumn.LocalTreatment - 1)))?null:(System.Int32?)reader[((int)DscColumn.LocalTreatment - 1)];
			entity.InProtectedEnviroZone = (reader.IsDBNull(((int)DscColumn.InProtectedEnviroZone - 1)))?null:(System.Int32?)reader[((int)DscColumn.InProtectedEnviroZone - 1)];
			entity.HasBasement = (reader.IsDBNull(((int)DscColumn.HasBasement - 1)))?null:(System.Int32?)reader[((int)DscColumn.HasBasement - 1)];
			entity.PropertyId = (reader.IsDBNull(((int)DscColumn.PropertyId - 1)))?null:(System.String)reader[((int)DscColumn.PropertyId - 1)];
			entity.ConnFracFromLinkUsNode = (reader.IsDBNull(((int)DscColumn.ConnFracFromLinkUsNode - 1)))?null:(System.Decimal?)reader[((int)DscColumn.ConnFracFromLinkUsNode - 1)];
			entity.FloodReferenceElevation = (reader.IsDBNull(((int)DscColumn.FloodReferenceElevation - 1)))?null:(System.Decimal?)reader[((int)DscColumn.FloodReferenceElevation - 1)];
			entity.FalseBasementBackupRisk = (reader.IsDBNull(((int)DscColumn.FalseBasementBackupRisk - 1)))?null:(System.Int32?)reader[((int)DscColumn.FalseBasementBackupRisk - 1)];
			entity.StateRnoId = (reader.IsDBNull(((int)DscColumn.StateRnoId - 1)))?null:(System.String)reader[((int)DscColumn.StateRnoId - 1)];
			entity.Owner1 = (reader.IsDBNull(((int)DscColumn.Owner1 - 1)))?null:(System.String)reader[((int)DscColumn.Owner1 - 1)];
			entity.Owner2 = (reader.IsDBNull(((int)DscColumn.Owner2 - 1)))?null:(System.String)reader[((int)DscColumn.Owner2 - 1)];
			entity.Owner3 = (reader.IsDBNull(((int)DscColumn.Owner3 - 1)))?null:(System.String)reader[((int)DscColumn.Owner3 - 1)];
			entity.OwnerAddress = (reader.IsDBNull(((int)DscColumn.OwnerAddress - 1)))?null:(System.String)reader[((int)DscColumn.OwnerAddress - 1)];
			entity.OwnerCity = (reader.IsDBNull(((int)DscColumn.OwnerCity - 1)))?null:(System.String)reader[((int)DscColumn.OwnerCity - 1)];
			entity.OwnerState = (reader.IsDBNull(((int)DscColumn.OwnerState - 1)))?null:(System.String)reader[((int)DscColumn.OwnerState - 1)];
			entity.OwnerZip = (reader.IsDBNull(((int)DscColumn.OwnerZip - 1)))?null:(System.String)reader[((int)DscColumn.OwnerZip - 1)];
			entity.SiteAddress = (reader.IsDBNull(((int)DscColumn.SiteAddress - 1)))?null:(System.String)reader[((int)DscColumn.SiteAddress - 1)];
			entity.SiteCity = (reader.IsDBNull(((int)DscColumn.SiteCity - 1)))?null:(System.String)reader[((int)DscColumn.SiteCity - 1)];
			entity.SiteState = (reader.IsDBNull(((int)DscColumn.SiteState - 1)))?null:(System.String)reader[((int)DscColumn.SiteState - 1)];
			entity.SiteZip = (reader.IsDBNull(((int)DscColumn.SiteZip - 1)))?null:(System.String)reader[((int)DscColumn.SiteZip - 1)];
			entity.FloodReferenceElevation2 = (reader.IsDBNull(((int)DscColumn.FloodReferenceElevation2 - 1)))?null:(System.Decimal?)reader[((int)DscColumn.FloodReferenceElevation2 - 1)];
			entity.IsVacant = (System.Int32)reader[((int)DscColumn.IsVacant - 1)];
			entity.ZoneEx = (reader.IsDBNull(((int)DscColumn.ZoneEx - 1)))?null:(System.String)reader[((int)DscColumn.ZoneEx - 1)];
			entity.ZoneCp = (reader.IsDBNull(((int)DscColumn.ZoneCp - 1)))?null:(System.String)reader[((int)DscColumn.ZoneCp - 1)];
			entity.GeneralZoneEx = (reader.IsDBNull(((int)DscColumn.GeneralZoneEx - 1)))?null:(System.String)reader[((int)DscColumn.GeneralZoneEx - 1)];
			entity.GeneralZoneCp = (reader.IsDBNull(((int)DscColumn.GeneralZoneCp - 1)))?null:(System.String)reader[((int)DscColumn.GeneralZoneCp - 1)];
			entity.ProtectedEnviroZone = (reader.IsDBNull(((int)DscColumn.ProtectedEnviroZone - 1)))?null:(System.Decimal?)reader[((int)DscColumn.ProtectedEnviroZone - 1)];
			entity.IaFractionEx = (reader.IsDBNull(((int)DscColumn.IaFractionEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IaFractionEx - 1)];
			entity.IaFractionCp = (reader.IsDBNull(((int)DscColumn.IaFractionCp - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IaFractionCp - 1)];
			entity.IaFractionFu = (reader.IsDBNull(((int)DscColumn.IaFractionFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.IaFractionFu - 1)];
			entity.TotalArea = (reader.IsDBNull(((int)DscColumn.TotalArea - 1)))?null:(System.Decimal?)reader[((int)DscColumn.TotalArea - 1)];
			entity.RoofAreaEx = (reader.IsDBNull(((int)DscColumn.RoofAreaEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.RoofAreaEx - 1)];
			entity.RoofAreaFu = (reader.IsDBNull(((int)DscColumn.RoofAreaFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.RoofAreaFu - 1)];
			entity.ParkingAreaEx = (reader.IsDBNull(((int)DscColumn.ParkingAreaEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.ParkingAreaEx - 1)];
			entity.ParkingAreaFu = (reader.IsDBNull(((int)DscColumn.ParkingAreaFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.ParkingAreaFu - 1)];
			entity.BaseflowEx = (reader.IsDBNull(((int)DscColumn.BaseflowEx - 1)))?null:(System.Decimal?)reader[((int)DscColumn.BaseflowEx - 1)];
			entity.BaseflowFu = (reader.IsDBNull(((int)DscColumn.BaseflowFu - 1)))?null:(System.Decimal?)reader[((int)DscColumn.BaseflowFu - 1)];
			entity.BaseflowDesignManual = (reader.IsDBNull(((int)DscColumn.BaseflowDesignManual - 1)))?null:(System.Decimal?)reader[((int)DscColumn.BaseflowDesignManual - 1)];
			entity.EditedBy = (System.String)reader[((int)DscColumn.EditedBy - 1)];
			entity.EditReason = (System.String)reader[((int)DscColumn.EditReason - 1)];
			entity.Status = (System.String)reader[((int)DscColumn.Status - 1)];
			entity.AppendDate = (System.DateTime)reader[((int)DscColumn.AppendDate - 1)];
			entity.EditDate = (reader.IsDBNull(((int)DscColumn.EditDate - 1)))?null:(System.DateTime?)reader[((int)DscColumn.EditDate - 1)];
			entity.SanToMlinkidDeprecated = (reader.IsDBNull(((int)DscColumn.SanToMlinkidDeprecated - 1)))?null:(System.Int32?)reader[((int)DscColumn.SanToMlinkidDeprecated - 1)];
			entity.StormToMlinkidDeprecated = (reader.IsDBNull(((int)DscColumn.StormToMlinkidDeprecated - 1)))?null:(System.Int32?)reader[((int)DscColumn.StormToMlinkidDeprecated - 1)];
			entity.DscidDeprecated = (reader.IsDBNull(((int)DscColumn.DscidDeprecated - 1)))?null:(System.Int32?)reader[((int)DscColumn.DscidDeprecated - 1)];
			entity.Shape = (reader.IsDBNull(((int)DscColumn.Shape - 1)))?null:(System.Object)reader[((int)DscColumn.Shape - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="BesAsm.MasterData.Entities.Dsc"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.Dsc"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, BesAsm.MasterData.Entities.Dsc entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.Objectid = (System.Int32)dataRow["OBJECTID"];
			entity.ParcelId = Convert.IsDBNull(dataRow["parcel_id"]) ? null : (System.Int32?)dataRow["parcel_id"];
			entity.DivideId = Convert.IsDBNull(dataRow["divide_id"]) ? null : (System.Int32?)dataRow["divide_id"];
			entity.DscId = (System.Int32)dataRow["dsc_id"];
			entity.OriginalDscId = (System.Int32)dataRow["dsc_id"];
			entity.DiscoSiteId = Convert.IsDBNull(dataRow["disco_site_id"]) ? null : (System.Int32?)dataRow["disco_site_id"];
			entity.DiscoClass = (System.String)dataRow["disco_class"];
			entity.SanToLinkId = Convert.IsDBNull(dataRow["san_to_link_id"]) ? null : (System.Int32?)dataRow["san_to_link_id"];
			entity.StormToLinkId = Convert.IsDBNull(dataRow["storm_to_link_id"]) ? null : (System.Int32?)dataRow["storm_to_link_id"];
			entity.SanPipeFlowType = Convert.IsDBNull(dataRow["san_pipe_flow_type"]) ? null : (System.String)dataRow["san_pipe_flow_type"];
			entity.StormPipeFlowType = Convert.IsDBNull(dataRow["storm_pipe_flow_type"]) ? null : (System.String)dataRow["storm_pipe_flow_type"];
			entity.SewerCrown = Convert.IsDBNull(dataRow["sewer_crown"]) ? null : (System.Decimal?)dataRow["sewer_crown"];
			entity.GrowthState = Convert.IsDBNull(dataRow["growth_state"]) ? null : (System.Int32?)dataRow["growth_state"];
			entity.CpUsedForFuAreaIncrease = Convert.IsDBNull(dataRow["cp_used_for_fu_area_increase"]) ? null : (System.Int32?)dataRow["cp_used_for_fu_area_increase"];
			entity.GisBasin = Convert.IsDBNull(dataRow["gis_basin"]) ? null : (System.String)dataRow["gis_basin"];
			entity.IcRoofEx = Convert.IsDBNull(dataRow["ic_roof_ex"]) ? null : (System.Decimal?)dataRow["ic_roof_ex"];
			entity.IcRoofFu = Convert.IsDBNull(dataRow["ic_roof_fu"]) ? null : (System.Decimal?)dataRow["ic_roof_fu"];
			entity.IcParkingEx = Convert.IsDBNull(dataRow["ic_parking_ex"]) ? null : (System.Decimal?)dataRow["ic_parking_ex"];
			entity.IcParkingFu = Convert.IsDBNull(dataRow["ic_parking_fu"]) ? null : (System.Decimal?)dataRow["ic_parking_fu"];
			entity.EffectiveIcRoofEx = Convert.IsDBNull(dataRow["effective_ic_roof_ex"]) ? null : (System.Decimal?)dataRow["effective_ic_roof_ex"];
			entity.EffectiveIcParkingEx = Convert.IsDBNull(dataRow["effective_ic_parking_ex"]) ? null : (System.Decimal?)dataRow["effective_ic_parking_ex"];
			entity.EffectiveIcRoofFu = Convert.IsDBNull(dataRow["effective_ic_roof_fu"]) ? null : (System.Decimal?)dataRow["effective_ic_roof_fu"];
			entity.EffectiveIcParkingFu = Convert.IsDBNull(dataRow["effective_ic_parking_fu"]) ? null : (System.Decimal?)dataRow["effective_ic_parking_fu"];
			entity.Sewerability = Convert.IsDBNull(dataRow["sewerability"]) ? null : (System.Int32?)dataRow["sewerability"];
			entity.DataSource = Convert.IsDBNull(dataRow["data_source"]) ? null : (System.String)dataRow["data_source"];
			entity.LocalTreatment = Convert.IsDBNull(dataRow["local_treatment"]) ? null : (System.Int32?)dataRow["local_treatment"];
			entity.InProtectedEnviroZone = Convert.IsDBNull(dataRow["in_protected_enviro_zone"]) ? null : (System.Int32?)dataRow["in_protected_enviro_zone"];
			entity.HasBasement = Convert.IsDBNull(dataRow["has_basement"]) ? null : (System.Int32?)dataRow["has_basement"];
			entity.PropertyId = Convert.IsDBNull(dataRow["property_id"]) ? null : (System.String)dataRow["property_id"];
			entity.ConnFracFromLinkUsNode = Convert.IsDBNull(dataRow["conn_frac_from_link_us_node"]) ? null : (System.Decimal?)dataRow["conn_frac_from_link_us_node"];
			entity.FloodReferenceElevation = Convert.IsDBNull(dataRow["flood_reference_elevation"]) ? null : (System.Decimal?)dataRow["flood_reference_elevation"];
			entity.FalseBasementBackupRisk = Convert.IsDBNull(dataRow["false_basement_backup_risk"]) ? null : (System.Int32?)dataRow["false_basement_backup_risk"];
			entity.StateRnoId = Convert.IsDBNull(dataRow["state_rno_id"]) ? null : (System.String)dataRow["state_rno_id"];
			entity.Owner1 = Convert.IsDBNull(dataRow["owner_1"]) ? null : (System.String)dataRow["owner_1"];
			entity.Owner2 = Convert.IsDBNull(dataRow["owner_2"]) ? null : (System.String)dataRow["owner_2"];
			entity.Owner3 = Convert.IsDBNull(dataRow["owner_3"]) ? null : (System.String)dataRow["owner_3"];
			entity.OwnerAddress = Convert.IsDBNull(dataRow["owner_address"]) ? null : (System.String)dataRow["owner_address"];
			entity.OwnerCity = Convert.IsDBNull(dataRow["owner_city"]) ? null : (System.String)dataRow["owner_city"];
			entity.OwnerState = Convert.IsDBNull(dataRow["owner_state"]) ? null : (System.String)dataRow["owner_state"];
			entity.OwnerZip = Convert.IsDBNull(dataRow["owner_zip"]) ? null : (System.String)dataRow["owner_zip"];
			entity.SiteAddress = Convert.IsDBNull(dataRow["site_address"]) ? null : (System.String)dataRow["site_address"];
			entity.SiteCity = Convert.IsDBNull(dataRow["site_city"]) ? null : (System.String)dataRow["site_city"];
			entity.SiteState = Convert.IsDBNull(dataRow["site_state"]) ? null : (System.String)dataRow["site_state"];
			entity.SiteZip = Convert.IsDBNull(dataRow["site_zip"]) ? null : (System.String)dataRow["site_zip"];
			entity.FloodReferenceElevation2 = Convert.IsDBNull(dataRow["flood_reference_elevation_2"]) ? null : (System.Decimal?)dataRow["flood_reference_elevation_2"];
			entity.IsVacant = (System.Int32)dataRow["is_vacant"];
			entity.ZoneEx = Convert.IsDBNull(dataRow["zone_ex"]) ? null : (System.String)dataRow["zone_ex"];
			entity.ZoneCp = Convert.IsDBNull(dataRow["zone_cp"]) ? null : (System.String)dataRow["zone_cp"];
			entity.GeneralZoneEx = Convert.IsDBNull(dataRow["general_zone_ex"]) ? null : (System.String)dataRow["general_zone_ex"];
			entity.GeneralZoneCp = Convert.IsDBNull(dataRow["general_zone_cp"]) ? null : (System.String)dataRow["general_zone_cp"];
			entity.ProtectedEnviroZone = Convert.IsDBNull(dataRow["protected_enviro_zone"]) ? null : (System.Decimal?)dataRow["protected_enviro_zone"];
			entity.IaFractionEx = Convert.IsDBNull(dataRow["ia_fraction_ex"]) ? null : (System.Decimal?)dataRow["ia_fraction_ex"];
			entity.IaFractionCp = Convert.IsDBNull(dataRow["ia_fraction_cp"]) ? null : (System.Decimal?)dataRow["ia_fraction_cp"];
			entity.IaFractionFu = Convert.IsDBNull(dataRow["ia_fraction_fu"]) ? null : (System.Decimal?)dataRow["ia_fraction_fu"];
			entity.TotalArea = Convert.IsDBNull(dataRow["total_area"]) ? null : (System.Decimal?)dataRow["total_area"];
			entity.RoofAreaEx = Convert.IsDBNull(dataRow["roof_area_ex"]) ? null : (System.Decimal?)dataRow["roof_area_ex"];
			entity.RoofAreaFu = Convert.IsDBNull(dataRow["roof_area_fu"]) ? null : (System.Decimal?)dataRow["roof_area_fu"];
			entity.ParkingAreaEx = Convert.IsDBNull(dataRow["parking_area_ex"]) ? null : (System.Decimal?)dataRow["parking_area_ex"];
			entity.ParkingAreaFu = Convert.IsDBNull(dataRow["parking_area_fu"]) ? null : (System.Decimal?)dataRow["parking_area_fu"];
			entity.BaseflowEx = Convert.IsDBNull(dataRow["baseflow_ex"]) ? null : (System.Decimal?)dataRow["baseflow_ex"];
			entity.BaseflowFu = Convert.IsDBNull(dataRow["baseflow_fu"]) ? null : (System.Decimal?)dataRow["baseflow_fu"];
			entity.BaseflowDesignManual = Convert.IsDBNull(dataRow["baseflow_design_manual"]) ? null : (System.Decimal?)dataRow["baseflow_design_manual"];
			entity.EditedBy = (System.String)dataRow["edited_by"];
			entity.EditReason = (System.String)dataRow["edit_reason"];
			entity.Status = (System.String)dataRow["status"];
			entity.AppendDate = (System.DateTime)dataRow["append_date"];
			entity.EditDate = Convert.IsDBNull(dataRow["edit_date"]) ? null : (System.DateTime?)dataRow["edit_date"];
			entity.SanToMlinkidDeprecated = Convert.IsDBNull(dataRow["san_to_mlinkid_deprecated"]) ? null : (System.Int32?)dataRow["san_to_mlinkid_deprecated"];
			entity.StormToMlinkidDeprecated = Convert.IsDBNull(dataRow["storm_to_mlinkid_deprecated"]) ? null : (System.Int32?)dataRow["storm_to_mlinkid_deprecated"];
			entity.DscidDeprecated = Convert.IsDBNull(dataRow["dscid_deprecated"]) ? null : (System.Int32?)dataRow["dscid_deprecated"];
			entity.Shape = Convert.IsDBNull(dataRow["SHAPE"]) ? null : (System.Object)dataRow["SHAPE"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.Dsc"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">BesAsm.MasterData.Entities.Dsc Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, BesAsm.MasterData.Entities.Dsc entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;

			#region ZoneCpSource	
			if (CanDeepLoad(entity, "DetailedZone|ZoneCpSource", deepLoadType, innerList) 
				&& entity.ZoneCpSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.ZoneCp ?? string.Empty);
				DetailedZone tmpEntity = EntityManager.LocateEntity<DetailedZone>(EntityLocator.ConstructKeyFromPkItems(typeof(DetailedZone), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.ZoneCpSource = tmpEntity;
				else
					entity.ZoneCpSource = DataRepository.DetailedZoneProvider.GetByDetailedZoneId(transactionManager, (entity.ZoneCp ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ZoneCpSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ZoneCpSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.DetailedZoneProvider.DeepLoad(transactionManager, entity.ZoneCpSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion ZoneCpSource

			#region ZoneExSource	
			if (CanDeepLoad(entity, "DetailedZone|ZoneExSource", deepLoadType, innerList) 
				&& entity.ZoneExSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.ZoneEx ?? string.Empty);
				DetailedZone tmpEntity = EntityManager.LocateEntity<DetailedZone>(EntityLocator.ConstructKeyFromPkItems(typeof(DetailedZone), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.ZoneExSource = tmpEntity;
				else
					entity.ZoneExSource = DataRepository.DetailedZoneProvider.GetByDetailedZoneId(transactionManager, (entity.ZoneEx ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ZoneExSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ZoneExSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.DetailedZoneProvider.DeepLoad(transactionManager, entity.ZoneExSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion ZoneExSource

			#region DiscoClassSource	
			if (CanDeepLoad(entity, "DiscoClass|DiscoClassSource", deepLoadType, innerList) 
				&& entity.DiscoClassSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.DiscoClass;
				DiscoClass tmpEntity = EntityManager.LocateEntity<DiscoClass>(EntityLocator.ConstructKeyFromPkItems(typeof(DiscoClass), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.DiscoClassSource = tmpEntity;
				else
					entity.DiscoClassSource = DataRepository.DiscoClassProvider.GetByDiscoClassId(transactionManager, entity.DiscoClass);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'DiscoClassSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.DiscoClassSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.DiscoClassProvider.DeepLoad(transactionManager, entity.DiscoClassSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion DiscoClassSource

			#region DataSourceSource	
			if (CanDeepLoad(entity, "DscDataSource|DataSourceSource", deepLoadType, innerList) 
				&& entity.DataSourceSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.DataSource ?? string.Empty);
				DscDataSource tmpEntity = EntityManager.LocateEntity<DscDataSource>(EntityLocator.ConstructKeyFromPkItems(typeof(DscDataSource), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.DataSourceSource = tmpEntity;
				else
					entity.DataSourceSource = DataRepository.DscDataSourceProvider.GetByName(transactionManager, (entity.DataSource ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'DataSourceSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.DataSourceSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.DscDataSourceProvider.DeepLoad(transactionManager, entity.DataSourceSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion DataSourceSource

			#region GrowthStateSource	
			if (CanDeepLoad(entity, "GrowthState|GrowthStateSource", deepLoadType, innerList) 
				&& entity.GrowthStateSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.GrowthState ?? (int)0);
				GrowthState tmpEntity = EntityManager.LocateEntity<GrowthState>(EntityLocator.ConstructKeyFromPkItems(typeof(GrowthState), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.GrowthStateSource = tmpEntity;
				else
					entity.GrowthStateSource = DataRepository.GrowthStateProvider.GetByGrowthStateId(transactionManager, (entity.GrowthState ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'GrowthStateSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.GrowthStateSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.GrowthStateProvider.DeepLoad(transactionManager, entity.GrowthStateSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion GrowthStateSource

			#region SanToLinkIdSource	
			if (CanDeepLoad(entity, "Link|SanToLinkIdSource", deepLoadType, innerList) 
				&& entity.SanToLinkIdSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.SanToLinkId ?? (int)0);
				Link tmpEntity = EntityManager.LocateEntity<Link>(EntityLocator.ConstructKeyFromPkItems(typeof(Link), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.SanToLinkIdSource = tmpEntity;
				else
					entity.SanToLinkIdSource = DataRepository.LinkProvider.GetByLinkId(transactionManager, (entity.SanToLinkId ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'SanToLinkIdSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.SanToLinkIdSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.LinkProvider.DeepLoad(transactionManager, entity.SanToLinkIdSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion SanToLinkIdSource

			#region StormToLinkIdSource	
			if (CanDeepLoad(entity, "Link|StormToLinkIdSource", deepLoadType, innerList) 
				&& entity.StormToLinkIdSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.StormToLinkId ?? (int)0);
				Link tmpEntity = EntityManager.LocateEntity<Link>(EntityLocator.ConstructKeyFromPkItems(typeof(Link), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.StormToLinkIdSource = tmpEntity;
				else
					entity.StormToLinkIdSource = DataRepository.LinkProvider.GetByLinkId(transactionManager, (entity.StormToLinkId ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'StormToLinkIdSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.StormToLinkIdSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.LinkProvider.DeepLoad(transactionManager, entity.StormToLinkIdSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion StormToLinkIdSource

			#region SewerabilitySource	
			if (CanDeepLoad(entity, "Sewerability|SewerabilitySource", deepLoadType, innerList) 
				&& entity.SewerabilitySource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.Sewerability ?? (int)0);
				Sewerability tmpEntity = EntityManager.LocateEntity<Sewerability>(EntityLocator.ConstructKeyFromPkItems(typeof(Sewerability), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.SewerabilitySource = tmpEntity;
				else
					entity.SewerabilitySource = DataRepository.SewerabilityProvider.GetBySewerabilityId(transactionManager, (entity.Sewerability ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'SewerabilitySource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.SewerabilitySource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.SewerabilityProvider.DeepLoad(transactionManager, entity.SewerabilitySource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion SewerabilitySource

			#region StatusSource	
			if (CanDeepLoad(entity, "Status|StatusSource", deepLoadType, innerList) 
				&& entity.StatusSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.Status;
				Status tmpEntity = EntityManager.LocateEntity<Status>(EntityLocator.ConstructKeyFromPkItems(typeof(Status), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.StatusSource = tmpEntity;
				else
					entity.StatusSource = DataRepository.StatusProvider.GetByStatusId(transactionManager, entity.Status);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'StatusSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.StatusSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.StatusProvider.DeepLoad(transactionManager, entity.StatusSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion StatusSource

			#region GeneralZoneCpSource	
			if (CanDeepLoad(entity, "Zone|GeneralZoneCpSource", deepLoadType, innerList) 
				&& entity.GeneralZoneCpSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.GeneralZoneCp ?? string.Empty);
				Zone tmpEntity = EntityManager.LocateEntity<Zone>(EntityLocator.ConstructKeyFromPkItems(typeof(Zone), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.GeneralZoneCpSource = tmpEntity;
				else
					entity.GeneralZoneCpSource = DataRepository.ZoneProvider.GetByZoneId(transactionManager, (entity.GeneralZoneCp ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'GeneralZoneCpSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.GeneralZoneCpSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.ZoneProvider.DeepLoad(transactionManager, entity.GeneralZoneCpSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion GeneralZoneCpSource

			#region GeneralZoneExSource	
			if (CanDeepLoad(entity, "Zone|GeneralZoneExSource", deepLoadType, innerList) 
				&& entity.GeneralZoneExSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.GeneralZoneEx ?? string.Empty);
				Zone tmpEntity = EntityManager.LocateEntity<Zone>(EntityLocator.ConstructKeyFromPkItems(typeof(Zone), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.GeneralZoneExSource = tmpEntity;
				else
					entity.GeneralZoneExSource = DataRepository.ZoneProvider.GetByZoneId(transactionManager, (entity.GeneralZoneEx ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'GeneralZoneExSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.GeneralZoneExSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.ZoneProvider.DeepLoad(transactionManager, entity.GeneralZoneExSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion GeneralZoneExSource
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			// Deep load child collections  - Call GetByDscId methods when available
			
			#region ParkingTargetCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<ParkingTarget>|ParkingTargetCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ParkingTargetCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.ParkingTargetCollection = DataRepository.ParkingTargetProvider.GetByDscId(transactionManager, entity.DscId);

				if (deep && entity.ParkingTargetCollection.Count > 0)
				{
					deepHandles.Add("ParkingTargetCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<ParkingTarget>) DataRepository.ParkingTargetProvider.DeepLoad,
						new object[] { transactionManager, entity.ParkingTargetCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region FixedFloorElevationCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<FixedFloorElevation>|FixedFloorElevationCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'FixedFloorElevationCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.FixedFloorElevationCollection = DataRepository.FixedFloorElevationProvider.GetByDscId(transactionManager, entity.DscId);

				if (deep && entity.FixedFloorElevationCollection.Count > 0)
				{
					deepHandles.Add("FixedFloorElevationCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<FixedFloorElevation>) DataRepository.FixedFloorElevationProvider.DeepLoad,
						new object[] { transactionManager, entity.FixedFloorElevationCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region IcDiscoCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<IcDisco>|IcDiscoCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IcDiscoCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.IcDiscoCollection = DataRepository.IcDiscoProvider.GetByDscId(transactionManager, entity.DscId);

				if (deep && entity.IcDiscoCollection.Count > 0)
				{
					deepHandles.Add("IcDiscoCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<IcDisco>) DataRepository.IcDiscoProvider.DeepLoad,
						new object[] { transactionManager, entity.IcDiscoCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region RoofTargetCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<RoofTarget>|RoofTargetCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'RoofTargetCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.RoofTargetCollection = DataRepository.RoofTargetProvider.GetByDscId(transactionManager, entity.DscId);

				if (deep && entity.RoofTargetCollection.Count > 0)
				{
					deepHandles.Add("RoofTargetCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<RoofTarget>) DataRepository.RoofTargetProvider.DeepLoad,
						new object[] { transactionManager, entity.RoofTargetCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region IcDrywellCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<IcDrywell>|IcDrywellCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IcDrywellCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.IcDrywellCollection = DataRepository.IcDrywellProvider.GetByDscId(transactionManager, entity.DscId);

				if (deep && entity.IcDrywellCollection.Count > 0)
				{
					deepHandles.Add("IcDrywellCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<IcDrywell>) DataRepository.IcDrywellProvider.DeepLoad,
						new object[] { transactionManager, entity.IcDrywellCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			#region DscZingerCollection
			//Relationship Type One : Many
			if (CanDeepLoad(entity, "List<DscZinger>|DscZingerCollection", deepLoadType, innerList)) 
			{
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'DscZingerCollection' loaded. key " + entity.EntityTrackingKey);
				#endif 

				entity.DscZingerCollection = DataRepository.DscZingerProvider.GetByDscId(transactionManager, entity.DscId);

				if (deep && entity.DscZingerCollection.Count > 0)
				{
					deepHandles.Add("DscZingerCollection",
						new KeyValuePair<Delegate, object>((DeepLoadHandle<DscZinger>) DataRepository.DscZingerProvider.DeepLoad,
						new object[] { transactionManager, entity.DscZingerCollection, deep, deepLoadType, childTypes, innerList }
					));
				}
			}		
			#endregion 
			
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the BesAsm.MasterData.Entities.Dsc object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">BesAsm.MasterData.Entities.Dsc instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">BesAsm.MasterData.Entities.Dsc Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, BesAsm.MasterData.Entities.Dsc entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			
			#region ZoneCpSource
			if (CanDeepSave(entity, "DetailedZone|ZoneCpSource", deepSaveType, innerList) 
				&& entity.ZoneCpSource != null)
			{
				DataRepository.DetailedZoneProvider.Save(transactionManager, entity.ZoneCpSource);
				entity.ZoneCp = entity.ZoneCpSource.DetailedZoneId;
			}
			#endregion 
			
			#region ZoneExSource
			if (CanDeepSave(entity, "DetailedZone|ZoneExSource", deepSaveType, innerList) 
				&& entity.ZoneExSource != null)
			{
				DataRepository.DetailedZoneProvider.Save(transactionManager, entity.ZoneExSource);
				entity.ZoneEx = entity.ZoneExSource.DetailedZoneId;
			}
			#endregion 
			
			#region DiscoClassSource
			if (CanDeepSave(entity, "DiscoClass|DiscoClassSource", deepSaveType, innerList) 
				&& entity.DiscoClassSource != null)
			{
				DataRepository.DiscoClassProvider.Save(transactionManager, entity.DiscoClassSource);
				entity.DiscoClass = entity.DiscoClassSource.DiscoClassId;
			}
			#endregion 
			
			#region DataSourceSource
			if (CanDeepSave(entity, "DscDataSource|DataSourceSource", deepSaveType, innerList) 
				&& entity.DataSourceSource != null)
			{
				DataRepository.DscDataSourceProvider.Save(transactionManager, entity.DataSourceSource);
				entity.DataSource = entity.DataSourceSource.Name;
			}
			#endregion 
			
			#region GrowthStateSource
			if (CanDeepSave(entity, "GrowthState|GrowthStateSource", deepSaveType, innerList) 
				&& entity.GrowthStateSource != null)
			{
				DataRepository.GrowthStateProvider.Save(transactionManager, entity.GrowthStateSource);
				entity.GrowthState = entity.GrowthStateSource.GrowthStateId;
			}
			#endregion 
			
			#region SanToLinkIdSource
			if (CanDeepSave(entity, "Link|SanToLinkIdSource", deepSaveType, innerList) 
				&& entity.SanToLinkIdSource != null)
			{
				DataRepository.LinkProvider.Save(transactionManager, entity.SanToLinkIdSource);
				entity.SanToLinkId = entity.SanToLinkIdSource.LinkId;
			}
			#endregion 
			
			#region StormToLinkIdSource
			if (CanDeepSave(entity, "Link|StormToLinkIdSource", deepSaveType, innerList) 
				&& entity.StormToLinkIdSource != null)
			{
				DataRepository.LinkProvider.Save(transactionManager, entity.StormToLinkIdSource);
				entity.StormToLinkId = entity.StormToLinkIdSource.LinkId;
			}
			#endregion 
			
			#region SewerabilitySource
			if (CanDeepSave(entity, "Sewerability|SewerabilitySource", deepSaveType, innerList) 
				&& entity.SewerabilitySource != null)
			{
				DataRepository.SewerabilityProvider.Save(transactionManager, entity.SewerabilitySource);
				entity.Sewerability = entity.SewerabilitySource.SewerabilityId;
			}
			#endregion 
			
			#region StatusSource
			if (CanDeepSave(entity, "Status|StatusSource", deepSaveType, innerList) 
				&& entity.StatusSource != null)
			{
				DataRepository.StatusProvider.Save(transactionManager, entity.StatusSource);
				entity.Status = entity.StatusSource.StatusId;
			}
			#endregion 
			
			#region GeneralZoneCpSource
			if (CanDeepSave(entity, "Zone|GeneralZoneCpSource", deepSaveType, innerList) 
				&& entity.GeneralZoneCpSource != null)
			{
				DataRepository.ZoneProvider.Save(transactionManager, entity.GeneralZoneCpSource);
				entity.GeneralZoneCp = entity.GeneralZoneCpSource.ZoneId;
			}
			#endregion 
			
			#region GeneralZoneExSource
			if (CanDeepSave(entity, "Zone|GeneralZoneExSource", deepSaveType, innerList) 
				&& entity.GeneralZoneExSource != null)
			{
				DataRepository.ZoneProvider.Save(transactionManager, entity.GeneralZoneExSource);
				entity.GeneralZoneEx = entity.GeneralZoneExSource.ZoneId;
			}
			#endregion 
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
	
			#region List<ParkingTarget>
				if (CanDeepSave(entity.ParkingTargetCollection, "List<ParkingTarget>|ParkingTargetCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(ParkingTarget child in entity.ParkingTargetCollection)
					{
						if(child.DscIdSource != null)
						{
							child.DscId = child.DscIdSource.DscId;
						}
						else
						{
							child.DscId = entity.DscId;
						}

					}

					if (entity.ParkingTargetCollection.Count > 0 || entity.ParkingTargetCollection.DeletedItems.Count > 0)
					{
						//DataRepository.ParkingTargetProvider.Save(transactionManager, entity.ParkingTargetCollection);
						
						deepHandles.Add("ParkingTargetCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< ParkingTarget >) DataRepository.ParkingTargetProvider.DeepSave,
							new object[] { transactionManager, entity.ParkingTargetCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<FixedFloorElevation>
				if (CanDeepSave(entity.FixedFloorElevationCollection, "List<FixedFloorElevation>|FixedFloorElevationCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(FixedFloorElevation child in entity.FixedFloorElevationCollection)
					{
						if(child.DscIdSource != null)
						{
							child.DscId = child.DscIdSource.DscId;
						}
						else
						{
							child.DscId = entity.DscId;
						}

					}

					if (entity.FixedFloorElevationCollection.Count > 0 || entity.FixedFloorElevationCollection.DeletedItems.Count > 0)
					{
						//DataRepository.FixedFloorElevationProvider.Save(transactionManager, entity.FixedFloorElevationCollection);
						
						deepHandles.Add("FixedFloorElevationCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< FixedFloorElevation >) DataRepository.FixedFloorElevationProvider.DeepSave,
							new object[] { transactionManager, entity.FixedFloorElevationCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<IcDisco>
				if (CanDeepSave(entity.IcDiscoCollection, "List<IcDisco>|IcDiscoCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(IcDisco child in entity.IcDiscoCollection)
					{
						if(child.DscIdSource != null)
						{
							child.DscId = child.DscIdSource.DscId;
						}
						else
						{
							child.DscId = entity.DscId;
						}

					}

					if (entity.IcDiscoCollection.Count > 0 || entity.IcDiscoCollection.DeletedItems.Count > 0)
					{
						//DataRepository.IcDiscoProvider.Save(transactionManager, entity.IcDiscoCollection);
						
						deepHandles.Add("IcDiscoCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< IcDisco >) DataRepository.IcDiscoProvider.DeepSave,
							new object[] { transactionManager, entity.IcDiscoCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<RoofTarget>
				if (CanDeepSave(entity.RoofTargetCollection, "List<RoofTarget>|RoofTargetCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(RoofTarget child in entity.RoofTargetCollection)
					{
						if(child.DscIdSource != null)
						{
							child.DscId = child.DscIdSource.DscId;
						}
						else
						{
							child.DscId = entity.DscId;
						}

					}

					if (entity.RoofTargetCollection.Count > 0 || entity.RoofTargetCollection.DeletedItems.Count > 0)
					{
						//DataRepository.RoofTargetProvider.Save(transactionManager, entity.RoofTargetCollection);
						
						deepHandles.Add("RoofTargetCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< RoofTarget >) DataRepository.RoofTargetProvider.DeepSave,
							new object[] { transactionManager, entity.RoofTargetCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<IcDrywell>
				if (CanDeepSave(entity.IcDrywellCollection, "List<IcDrywell>|IcDrywellCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(IcDrywell child in entity.IcDrywellCollection)
					{
						if(child.DscIdSource != null)
						{
							child.DscId = child.DscIdSource.DscId;
						}
						else
						{
							child.DscId = entity.DscId;
						}

					}

					if (entity.IcDrywellCollection.Count > 0 || entity.IcDrywellCollection.DeletedItems.Count > 0)
					{
						//DataRepository.IcDrywellProvider.Save(transactionManager, entity.IcDrywellCollection);
						
						deepHandles.Add("IcDrywellCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< IcDrywell >) DataRepository.IcDrywellProvider.DeepSave,
							new object[] { transactionManager, entity.IcDrywellCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
	
			#region List<DscZinger>
				if (CanDeepSave(entity.DscZingerCollection, "List<DscZinger>|DscZingerCollection", deepSaveType, innerList)) 
				{	
					// update each child parent id with the real parent id (mostly used on insert)
					foreach(DscZinger child in entity.DscZingerCollection)
					{
						if(child.DscIdSource != null)
						{
							child.DscId = child.DscIdSource.DscId;
						}
						else
						{
							child.DscId = entity.DscId;
						}

					}

					if (entity.DscZingerCollection.Count > 0 || entity.DscZingerCollection.DeletedItems.Count > 0)
					{
						//DataRepository.DscZingerProvider.Save(transactionManager, entity.DscZingerCollection);
						
						deepHandles.Add("DscZingerCollection",
						new KeyValuePair<Delegate, object>((DeepSaveHandle< DscZinger >) DataRepository.DscZingerProvider.DeepSave,
							new object[] { transactionManager, entity.DscZingerCollection, deepSaveType, childTypes, innerList }
						));
					}
				} 
			#endregion 
				
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region DscChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>BesAsm.MasterData.Entities.Dsc</c>
	///</summary>
	public enum DscChildEntityTypes
	{
		
		///<summary>
		/// Composite Property for <c>DetailedZone</c> at ZoneCpSource
		///</summary>
		[ChildEntityType(typeof(DetailedZone))]
		DetailedZone,
			
		///<summary>
		/// Composite Property for <c>DiscoClass</c> at DiscoClassSource
		///</summary>
		[ChildEntityType(typeof(DiscoClass))]
		DiscoClass,
			
		///<summary>
		/// Composite Property for <c>DscDataSource</c> at DataSourceSource
		///</summary>
		[ChildEntityType(typeof(DscDataSource))]
		DscDataSource,
			
		///<summary>
		/// Composite Property for <c>GrowthState</c> at GrowthStateSource
		///</summary>
		[ChildEntityType(typeof(GrowthState))]
		GrowthState,
			
		///<summary>
		/// Composite Property for <c>Link</c> at SanToLinkIdSource
		///</summary>
		[ChildEntityType(typeof(Link))]
		Link,
			
		///<summary>
		/// Composite Property for <c>Sewerability</c> at SewerabilitySource
		///</summary>
		[ChildEntityType(typeof(Sewerability))]
		Sewerability,
			
		///<summary>
		/// Composite Property for <c>Status</c> at StatusSource
		///</summary>
		[ChildEntityType(typeof(Status))]
		Status,
			
		///<summary>
		/// Composite Property for <c>Zone</c> at GeneralZoneCpSource
		///</summary>
		[ChildEntityType(typeof(Zone))]
		Zone,
	
		///<summary>
		/// Collection of <c>Dsc</c> as OneToMany for ParkingTargetCollection
		///</summary>
		[ChildEntityType(typeof(TList<ParkingTarget>))]
		ParkingTargetCollection,

		///<summary>
		/// Collection of <c>Dsc</c> as OneToMany for FixedFloorElevationCollection
		///</summary>
		[ChildEntityType(typeof(TList<FixedFloorElevation>))]
		FixedFloorElevationCollection,

		///<summary>
		/// Collection of <c>Dsc</c> as OneToMany for IcDiscoCollection
		///</summary>
		[ChildEntityType(typeof(TList<IcDisco>))]
		IcDiscoCollection,

		///<summary>
		/// Collection of <c>Dsc</c> as OneToMany for RoofTargetCollection
		///</summary>
		[ChildEntityType(typeof(TList<RoofTarget>))]
		RoofTargetCollection,

		///<summary>
		/// Collection of <c>Dsc</c> as OneToMany for IcDrywellCollection
		///</summary>
		[ChildEntityType(typeof(TList<IcDrywell>))]
		IcDrywellCollection,

		///<summary>
		/// Collection of <c>Dsc</c> as OneToMany for DscZingerCollection
		///</summary>
		[ChildEntityType(typeof(TList<DscZinger>))]
		DscZingerCollection,
	}
	
	#endregion DscChildEntityTypes
	
	#region DscFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;DscColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Dsc"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class DscFilterBuilder : SqlFilterBuilder<DscColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the DscFilterBuilder class.
		/// </summary>
		public DscFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the DscFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public DscFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the DscFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public DscFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion DscFilterBuilder
	
	#region DscParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;DscColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Dsc"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class DscParameterBuilder : ParameterizedSqlFilterBuilder<DscColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the DscParameterBuilder class.
		/// </summary>
		public DscParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the DscParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public DscParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the DscParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public DscParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion DscParameterBuilder
	
	#region DscSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;DscColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Dsc"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class DscSortBuilder : SqlSortBuilder<DscColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the DscSqlSortBuilder class.
		/// </summary>
		public DscSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion DscSortBuilder
	
} // end namespace
